package dto

import (
	"time"

	"gitee.com/hp-huiw/my-go-core/security"
)

type UserCore struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	Enabled  *bool  `json:"enabled,omitempty"`
}

type UserRolesRequest struct {
	ID        string `json:"id" binding:"required"`
	Username  string `json:"username" binding:"required"`
	FullRoles []struct {
		ID string `json:"id" binding:"required"`
	} `json:"fullRoles" binding:"required"`
}

type UserStatusResponse struct {
	UserCore
	AccountExpired  bool `json:"accountExpired"`
	AccountLocked   bool `json:"accountLocked"`
	PasswordExpired bool `json:"passwordExpired"`
}

type UserBasicInfoResponse struct {
	UserCore
	FullName              string `json:"fullName"`
	AvatarUrl             string `json:"avatarUrl"`
	IsAccountGroupCreator *bool  `json:"isAccountGroupCreator,omitempty"`
	IsAccountGroupAdmin   *bool  `json:"isAccountGroupAdmin,omitempty"`
}

type UserDetailResponse struct {
	UserBasicInfoResponse
	AccountGroupID string              `json:"accountGroupId"`
	Description    *string             `json:"description"`
	FullRoles      []security.FullRole `json:"fullRoles"`
	DateCreated    time.Time           `json:"dateCreated"`
	LastUpdated    time.Time           `json:"lastUpdated"`
}
